<?php

class reporte extends object_standard {

    //attribute variables 
    protected $codigo;
    protected $descripcion;
    protected $estado_actual;
    protected $estado_siguiente;
    protected $fecha;
    protected $empleado;
    protected $codigo_guia;



    //components 
    var $components = array();
    //auxiliars for primary key and for files 
    var $auxiliars = array();

    //data about the attributes 
   public function metadata() {
        return array("codigo" => array(),"descripcion" => array(),
            "estado_actual" => array("foreign_name" => "fa_r", "foreign" => "fase", "foreign_attribute" => "codigo"),            
            "estado_siguiente" => array("foreign_name" => "fs_r", "foreign" => "fase", "foreign_attribute" => "codigo"),
            "fecha" => array(),
            "empleado" => array("foreign_name" => "e_r", "foreign" => "empleado", "foreign_attribute" => "identificacion"),
            "codigo_guia" => array("foreign_name" => "g_r", "foreign" => "guia", "foreign_attribute" => "codigo"));
    }

    public function primary_key() {
        return array("codigo");
    }

    public function relational_keys($class, $rel_name) {
        switch ($class) {
            case "empleado":
                switch ($rel_name) {
                    case "e_r":
                        return array("empleado");
                        break;
                }
            case "guia":
                switch ($rel_name) {
                    case "g_r":
                        return array("codigo_guia");
                        break;
                }
            case "fase":
            switch ($rel_name) {
                case "fa_r":
                    return array("estado_actual");
                    break;
                case "fs_r":
                    return array("estado_siguiente");
                    break;
            }    
                break;

            default:
                break;
        }
    }
/*
    public function aumento() {
        return $this->salary * 1.1;
    }
*/
}

?>